package com.jx.demo5.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jx.demo5.dao.BookMapper;
import com.jx.demo5.entity.Book;
import org.springframework.stereotype.Service;


@Service
public class BookServicelmpl extends ServiceImpl<BookMapper,Book> implements BookService{

//    @Resource
//    BaseMapper baseMapper;
//    @Override
//    public List<Book> BOOK_LIST(Book book) {
//        LambdaQueryWrapper<Book> queryWrapper = new LambdaQueryWrapper<>();
//        if (book.getName()!=""&&book.getName()!=null) {
//            queryWrapper.like(Book::getName,book.getName());
//        }
//        if (book.getAuthor()!=""&&book.getAuthor()!=null) {
//            queryWrapper.like(Book::getAuthor,book.getAuthor());
//        }
//        if (book.getCategory()!=""&&book.getCategory()!=null) {
//            queryWrapper.eq(Book::getCategory,book.getCategory());
//        }
//        return baseMapper.selectList(queryWrapper);
//    }
//
//    @Override
//    public IPage<Book> getPage(int num,Book book) {
//      return null;
//    }
//
//    @Override
//    public void add(Book book) {
//        baseMapper.insert(book);
//    }
//
//    @Override
//    public void update(Book book) {
//        baseMapper.updateById(book);
//    }
//
//    @Override
//    public Book updateId(Integer id) {
//        Book book = (Book) baseMapper.selectById(id);
//        return book;
//    }
//
//    @Override
//    public void del(Integer[] ids) {
//        baseMapper.deleteBatchIds(Arrays.stream(ids).toList());
//    }
}
